<?php

class Application_Model_DbTable_Character extends Zend_Db_Table_Abstract
{

    protected $_name = 'txy_item_characters';

    public function getCharacterInfo($characterName,$level){
    	if(stristr($characterName, ',')){
    		$characterName=Txy_Util_Character::getSqlStr($characterName);
    		$where="name in (".$characterName.") and level='".$level."'";
    	}else{
    		$where="name = '".$characterName."' and level='".$level."'";
    	}
    	$res=$this->fetchAll($where);
		return $res;
    }
    
    public function getCharacterInfoByName($characterName){
        $res=$this->fetchRow("name = '".trim($characterName)."'");
        if(null!=$res){
            return $res->toArray();
        }else{
            throw new Exception("标签不匹配", "1");
        }
    }

}

